package com.example.timeemail.fragment;

import android.app.Fragment;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.example.timeemail.R;

import static android.content.Context.MODE_PRIVATE;


/**
 * User:Shine
 * Date:2015-10-20
 * Description:
 */
public class PersonFragment extends Fragment {

    private TextView textView2;


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View inflate = inflater.inflate(R.layout.fragment_person, container, false);

        SharedPreferences sharedPreferences = this.getActivity().getSharedPreferences("loginData", MODE_PRIVATE);
        String username = sharedPreferences.getString("username", null);

        textView2 = inflate.findViewById(R.id.textView2);
        if (username != null) {
            textView2.setText("我的 ID：" + username);
        }

        return inflate;
    }
}
